  var nodemailer = require('./com/swancor/module/nodemailer');
 
  var transport = nodemailer.createTransport('SMTP', {
    host: 'smtp.gmail.com',
    secureConnection: true,
    port: 465,
    auth: {
      user: "anderson.all.box@gmail.com",
      pass: "key5379843"
    }
  });
  var msg = {
		      transport: transport,
		      text: "Hello! This is your newsletter, :D",
		      from: "Definitely Not Spammers <spamnot@ok.com>",
		      subject: "Your Newsletter"
		    };  
  var maillist = [
                  'Mr One <anderson@swancor.com>',
                  'Mr One <cd5379843@gmail.com>',
                 ];  
  var i = 0;
  maillist.forEach(function (to) {
     msg.to = to;
     nodemailer.sendMail(msg, function (err) {
         if (err) { console.log('Sending to ' + to + ' failed: ' + err); }
            console.log('Sent to ' + to);
            i += 1
         if (i === maillist.length) { msg.transport.close(); }
         });
  });  